2023年2月20日 — The :focus CSS pseudo-class represents an element (such as a form input) that has received focus. It is generally triggered when the user ...
The :focus selector is used to select the element that has focus. Tip: The :focus selector is allowed on elements that accept keyboard events or other user ...
} · background-color: lightblue; · <body> · <h2>Input fields with color on :focus</h2> · <p>Here, the input field gets a color when it gets focus (clicked on):</p>